﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<div class="box">
    <h2 id="title-createcategory">Create category</h2>
        
    <% using (Html.BeginForm("CreateCategory", "Admin", FormMethod.Post, new { @class = "standardform" }))
    { %>
        
    <div class="boxcontent">
        <table>
            <tr>
                <td>Parent</td>
                <td><%= Html.DropDownList("categoryparent", UIHelper.GetCategoriesAsItemList(), new { @class = "fullwidth" }) %></td>
                <td class="hint"></td>
            </tr>
            
            <tr>
                <td colspan="3" style="height: 15px;"></td>
            </tr>
            
            <tr>
                <td style="width: 140px;">Name</td>
                <td style="width: 200px;"><%= Html.TextBox("categoryname", "", new { @class = "fullwidth" }) %></td>
                <td class="hint"></td>
            </tr>
            
            <tr>
                <td>Description</td>
                <td><%= Html.TextBox("categorydescription", "", new { @class = "fullwidth" }) %></td>
                <td class="hint"></td>
            </tr>
            
            <tr>
                <td>Icon URL</td>
                <td><%= Html.TextBox("categoryiconurl", "~/img/", new { @class = "fullwidth" }) %></td>
                <td class="hint"></td>
            </tr>
            
            <tr>
                <td colspan="3" style="height: 15px;"></td>
            </tr>
            
            <tr>
                <td>Meta Fields</td>
                <td>
                    <input type="hidden" name="categorymetafields" id="categorymetafields" />
                    
                    <table class="fullwidth" cellpadding="0" cellspacing="1">
                        <tr>
                            <td><%= Html.DropDownList("existingmetafields", UIHelper.GetMetaFieldsAsList(), new { @class = "fullwidth" }) %></td>
                            <td><input type="button" value="+" id="addmetafield" /></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div style="height: 100px; overflow: auto; border: 1px solid #f0f0f0; padding: 2px; margin-top: 2px;">
                                    <ul id="metafieldlist" class="simpleul"></ul>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="hint"></td>
            </tr>
        </table>
    </div>
        
    <div class="boxfooter">
        <input type="submit" value="Create" id="button-createcategory" />
    </div>
        
    <%} %>
</div>
